/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Joe Morreale
 * @author keitchcasamento
 * @date May 11, 2010
 */
public class AdminAPI extends Database
{
    /**
     *
     * @param int id of player
     */
    public void getPlayer(int id)
    {
            Investor inv = getInvestor(id);
            System.out.println("\nInvestor ID: " + inv.getID() +
                            "\nName: " + inv.getName() +
                            "\nEmail Address: " + inv.getEmail() +
                            "\nCash Balance: " + inv.getCash()
                            );
    }

    /**
     *
     * @param int id of player selected to win award
     */
    public void selectAwards(int id)
    {
            Investor winner = getInvestor(id);
            //Implement a connection to PayPal for rewards
            System.out.println("Sent money to paypal for player " + winner.getName() );
    }

    /**
     *
     * @param int id of ad company
     * @param int new balance
     */
    public void updateAdBalance(int adid, double balance)
    {
            AdCompany comp = getAdCompany(adid);
            comp.setBalance(balance);
            updateAdCompany(comp);
            System.out.println("New balance owed is " + balance);
    }

    /**
     *
     * @param int id of player needing to be removed
     */
    public void removePlayer(int id)
    {
            removeInvestor(id);
            System.out.println("Player id# " + id + " has been removed");
    }

    /**
     *
     * @param int id of ad company needed to be removed
     */
    public void removeAdComp(int adid)
    {
            removeAdCompany(adid);
            System.out.println("Ad company id# " + adid + " has been removed");
    }

    /**
     *
     * @param int id of Investor to be removed
     */
    public void removeInvestor(int id)
    {
        investors.remove(id);
    }

}
